import { defineStore } from "pinia";
import { ref } from "vue";

export const useUserInfoStore = defineStore(
  "userInfo",
  () => {
    const userInfo = ref({});

    const setUserInfo = (newInfo) => {
      userInfo.value = newInfo;
    };

    const clearUserInfo = () => {
      userInfo.value = {};
    };
    return { userInfo, setUserInfo, clearUserInfo };
  },
  {
    persist: true,
  }
);
